<?php
namespace apps\common\models;
if( ! APP_ROOT  ) return 'Direct Access Deny!';

use Phalcon\Mvc\Model;
use Phalcon\Mvc\Model\Behavior\SoftDelete;
use enums\SystemEnums;

/**
 *  博物馆管理表
 *  @author Carey
 *  @date 2016-06-24
 *
 */
class Museum extends Model
{
    
    public $id;
    
    public $create_time;
    
    public $status;
    
    public $delsign;
    
    public $update_time;
    
    public $chief_image;
    
    public $brief;
    
    public $rank;
    
    public $weight;
    
    public $balance;
    
    public $score;
    
    public $mem_rank;
    
    public $name;
    
    public $content;
    
    public $district_id;
    
    public $address;
    
    public $zipcode;
    
    public $kind;
    
    public $visit_count;
    
    public $follow_count;
    
    public $price;
    
    public $begin_time;
    
    public $end_time;
    
    public $remarks;
    
    public $admin_id;
    
    public $agency_id;
    
    public $auditor_id;
    
    public $open_id;
    
    public $union_id;
    
    public $found_time;
    
    public $email;
    
    public $telphone;
    
    public $balance_avail;
    
    public $nature;
    
    public $connect_name;
    
    public $qualification_rank;
    
    public $linkman_cellphone;
    
    public function initialize()
    {
        $this->useDynamicUpdate( true );
    
        $this->addBehavior( new SoftDelete( array(
            'field' => 'delsign',
            'value' => SystemEnums::DELSIGN_YES,
        ) ) );
    
        $this->hasOne( 'id' , 'apps\mobile\models\MuseumCurator' , 'museum_id' , array( 'alias' => 'museum_curator' ) );
    
        $this->setSource( 'bwyt_museums' );
    }
    
    public function columnMap()
    {
        return array(
            'id'            => 'id',
            'create_time'   => 'create_time',
            'status'        => 'status',
            'delsign'       => 'delsign',
            'update_time'   => 'update_time',
            'chief_image'   => 'chief_image',
            'brief'         => 'brief',
            'rank'          => 'rank',
            'weight'        => 'weight',
            'balance'       => 'balance',
            'score'         => 'score',
            'mem_rank'      => 'mem_rank',
            'name'          => 'name',
            'content'       => 'content',
            'district_id'   => 'district_id',
            'address'       => 'address',
            'zipcode'       => 'zipcode',
            'kind'          => 'kind',
            'visit_count'   => 'visit_count',
            'follow_count'  => 'follow_count',
            'price'         => 'price',
            'begin_time'    => 'begin_time',
            'end_time'      => 'end_time',
            'remarks'       => 'remarks',
            'admin_id'      => 'admin_id',
            'agency_id'     => 'agency_id',
            'auditor_id'    => 'auditor_id',
            'open_id'       => 'open_id',
            'union_id'      => 'union_id',
            'found_time'    => 'found_time',
            'email'         => 'email',
            'telphone'      => 'telphone',
            'balance_avail' => 'balance_avail',
            'nature'        => 'nature',
            'connect_name'  => 'connect_name',
            'qualification_rank'    => 'qualification_rank',
            'linkman_cellphone' => 'linkman_cellphone',
        );
    }
    
    
}

?>